package main

import (
	"log"
	"server_cluster/battle/battle_config"
	"server_cluster/battle/sharemem"
	"server_cluster/common/tools"
)

func main() {
	for i:=0;i<100;i++ {
		tools.MyRand(100000,999999)
	}
	for i:=0;i<100;i++ {
		tools.MyRand(0,1)
	}
	return
	battle_config.InitConfig()
	shmid := sharemem.Get_myshm(&(sharemem.Myshm))
	if shmid <= 0 {
		log.Fatal("get myshm fail.")
		return
	}
	//
	sharemem.Init_config_index()
	sharemem.Init_all_user_index()

	//	log.Println(sharemem.Get_config_skill_effect(110080001))
	//log.Println(sharemem.Get_config_skill_passive(100101))
	//	log.Println(sharemem.Get_config_skill_child(110080101))
	//	log.Println(sharemem.Get_config_captain(1))

	u, ok := sharemem.GetShmUserMap()[1234567]
	if !ok {
		log.Fatal("get user fail.")
		return
	}
	//用shm数据生成临时战场
	bt := u.BuildBattleArea()
	if bt == nil {
		log.Printf("build battle area error.user = %d", u.GetId())
		return
	}
	if !u.RunBattle(bt) {
		log.Printf("user %d game over.", u.GetId())
		return
	}
}
